#pragma once
#include <string>


class CbintreeCode
{
public:
	CbintreeCode(void);
	CbintreeCode(std::string code);
	~CbintreeCode(void);

	enum Direction{SOUTH_EAST,WEST,NORTH_EAST,SOUTH,NORTH_WEST,EAST,SOUTH_WEST,NORTH};

	void GetPos(float &x0,float &y0,float &x1,float &y1,float &x2,float &y2);
	void GetPos(float &x0,float &y0);


	static std::string GetBaseCode(const std::string &code);
	static std::string GetLeftCode(const std::string &code);
	static std::string GetRightCode(const std::string &code);
	static std::string GetLeftChildCode(const std::string &code);
	static std::string GetRightChildCode(const std::string &code);
	static unsigned int GetHashNum(const std::string &code);
	static std::string GetParentCode(const std::string &code);
	static std::string GetBrotherCode(const std::string &code);
//	static unsigned int BinStrToInt(const std::string &code);

	std::string GetCode() const {return mCode;}	
	void Load(std::string  code){mCode=code;}

	
protected:
	std::string mCode;
	static int DirX[8];
	static int DirY[8];
};
